package com.ccn.crm.taskController;

import com.ccn.crm.mapper.UserViewMapper;
import com.ccn.crm.model.UserView;
import com.ccn.crm.service.IUserView;
import com.ccn.crm.service.impl.UserViewServiceImpl;
import com.ccn.crm.util.DateUtil;
import com.ccn.crm.util.EmailUtil;
import com.ccn.crm.util.StringUtil;
import org.apache.ibatis.annotations.Param;
import org.junit.jupiter.params.shadow.com.univocity.parsers.annotations.Convert;
import org.springframework.beans.factory.annotation.Autowired;

import java.math.BigDecimal;
import java.text.*;
import java.util.*;

public class dateUtil {

    public static void main(String[] args)  {
//        Date date = new Date();
//        System.out.println(date);
//        SimpleDateFormat formatter = new SimpleDateFormat("dd-MMM-yyyy");
//        String dateString = formatter.format(date);
//        Date dates = formatter.parse(dateString);
//        System.out.println(dates);

        //获取当天13:00:00的时间 字符串类型 2020-07-01 13:00:00
//        DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//        Calendar c = Calendar.getInstance();
//        c.add(Calendar.DAY_OF_YEAR, 0);
//        c.set(Calendar.HOUR_OF_DAY, 0);
//        c.set(Calendar.MINUTE, 0);
//        c.set(Calendar.SECOND, 0);
//        c.set(Calendar.MILLISECOND, 0);
//        Long time = c.getTime().getTime();
//        System.out.println(time);
//        System.out.println(df.format(c.getTime()));

//        //获取当天13:00:00的时间 date类型 Wed Jul 01 13:00:00 CST 2020
//        Calendar calendar = Calendar.getInstance();
//        calendar.setTime(new Date());
//        calendar.add(Calendar.DAY_OF_YEAR, 0);
//        calendar.set(Calendar.HOUR_OF_DAY, 13);
//        calendar.set(Calendar.MINUTE, 0);
//        calendar.set(Calendar.SECOND, 0);
//        Date zero = calendar.getTime();
//        System.out.println(zero);
//        SimpleDateFormat sdf = new SimpleDateFormat("yyMMdd ");
//        String dateString = sdf.format(date);
//        System.out.println(dateString);

//        SimpleDateFormat sdft = new SimpleDateFormat("yyyy-MM-dd ");
//        String dateStrings = sdft.format(date);
//        System.out.println(dateStrings);

        //获取当天凌晨时间
//        Calendar calendar = Calendar.getInstance();
//        calendar.setTime(new Date());
//        calendar.set(Calendar.HOUR_OF_DAY, 0);
//        calendar.set(Calendar.MINUTE, 0);
//        calendar.set(Calendar.SECOND, 0);
//        Date zero = calendar.getTime();
//        SimpleDateFormat sdfss = new SimpleDateFormat("yyyy-MM-dd  HH:mm:ss");
//        String dateStringss = sdfss.format(zero);
//        System.out.println(dateStringss);

//        //获取时间戳
//        long time=System.currentTimeMillis();
//        System.out.println(time);
//
////        System.out.println(dateString);
////        System.out.println(sdf);
////        System.out.println(date);
//        System.out.println("1111111111111111");
        //日期转时间戳
//        String cc = "2020-01-01 00:00:00";
//        String aa = "2020-01-05 00:00:00";
//        String format="yyyy-MM-dd HH:mm:ss";
//        SimpleDateFormat ss = new SimpleDateFormat(format);
//        String bb= String.valueOf(ss.parse(cc).getTime());
//        System.out.println(bb);
//        String vv= String.valueOf(ss.parse(aa).getTime());
//        System.out.println(vv);
//        Date date = ss.parse( " 2020-01-01 00:00:00 " );
//        long time = date.getTime();
//        System.out.println(time);
//        Date now = new Date();
//        Date now_10 = new Date(now.getTime() - 660000); //10分钟前的时间
//        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//可以方便地修改日期格式
//        String nowTime_10 = dateFormat.format(now_10);
//        String bb= String.valueOf(dateFormat.parse(nowTime_10).getTime());
//        System.out.println(bb);
//        System.out.println(nowTime_10);


//        //时间戳变时间格式

//        long dd=1608779090118l;
//        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
////             Date d=new Date(dd);
////        System.out.println(d );
//        //1614915690
//        long aa=1614873600000l+60000*60*12;
//        Date date = new Date(aa);
//        System.out.println(date);
//        String format1 = sdf.format(new Date(aa));
//        System.out.println(format1);
//        //string 转date

//        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
//        Date t = simpleDateFormat.parse("0000-01-01 00:00:00");
//        System.out.println(t);

//        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//        String dateString = sdf.format(t);
//        System.out.println(dateString);

//        String str="12%";//字符串类型的百分数
//        NumberFormat nf= NumberFormat.getPercentInstance();
////NumberFormat是一个工厂，可以直接getXXX创建，而getPercentInstance() 是返回当前默认语言环境的百分比格式。
//        Double m=(Double) nf.parse(str);
//        System.out.println(m);

//        String str="12%";//字符串类型的百分数
//        NumberFormat nf=NumberFormat.getPercentInstance();
////NumberFormat是一个工厂，可以直接getXXX创建，而getPercentInstance() 是返回当前默认语言环境的百分比格式。
//        Number m=nf.parse(str);//parse(xx)表示解析给定字符串开头的文本，生成一个数值，逐步地解析字符串的各部分
//        System.out.println(m);//打印数值

//        double f = 0.5585;
//        BigDecimal b = new BigDecimal(f);
//        double f1 = b.setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue();
//        System.out.println(f1);
//        System.out.println(Integer.parseInt(new DecimalFormat("0").format(f*100))+"%");

//        String aa="20.5%";
//        Double b=Double.parseDouble(aa.replace("%", ""));
//        System.out.println(b); 1597303313772 1597304505463

//        Date date = new Date(1597313812433l);
//        System.out.println(date);
//        long time = new Date().getTime();
//        System.out.println(time);

        //保留两位小数
//        Double f=0.13444;
//        DecimalFormat abc = new DecimalFormat("0.00");
//        String ss = abc.format(f);
//        System.out.println(ss);
//
        //日期差
//        String cc = "2020-01-01 11:00:00";
//        String aa = "2020-01-05 00:00:00";
//        String format="yyyy-MM-dd HH:mm:ss";
//        SimpleDateFormat ss = new SimpleDateFormat(format);
//        Date parse = ss.parse(cc);
//        Date parse1 = ss.parse(aa);
//        int i = DateUtil.daysBetween(parse, parse1);
//        System.out.println(i);


//        try {
//            int a =10;
//            int b= a/0;
//        }catch (Exception e) {
//            EmailUtil emailUtil = new EmailUtil();
//            emailUtil.sendMail(e.toString());
//            System.out.println(e.getMessage());
//            System.out.println("-----------------");
//            System.out.println(e.toString());
//        }
//        Date today8 = DateUtil.getToday8();
//        Date today18 = DateUtil.getToday18();
//        System.out.println(today8);
//        System.out.println(today18);
//        long times= new Date().getTime();
//        long time = new Date().getTime()- 60000*30*48*60;
//        System.out.println(time);
//        System.out.println(times);

//        Map<Object,Object> conditions=new HashMap<Object,Object>();
//        conditions.put("Aa","12");
//        Object put = conditions.put("BB", "123");
//        System.out.println("Aa".hashCode());
//        System.out.println("BB".hashCode());
//        System.out.println(put);

//        String aa = ",21,";
//        String substring = aa.substring(1, aa.length() - 1);
////        System.out.println(substring);
//        DateUtil.beforeOneDay();
//        DateUtil.beforeSevenDay();

//       String  str1="1,2,3,4,44,5,6,33,76";
//       String  str2=",33";
//       String  str3=str1.replaceAll(str2,"");
//        System.out.println(str3);
        //1610380800000
//        Long todayTimeCuo = DateUtil.getTodayTimeCuo();
//        System.out.println(todayTimeCuo);
//        System.out.println(new Date(todayTimeCuo));

//        String a="055447517";
//        String b="055447517";
//
//        if(!a.equals(b)&&!a.contains(b)){
//            System.out.println("不包含");
//        }else {
//            System.out.println("包含");
//        }
//        List<Object> productPlatforms= new ArrayList<Object>() ;
//        productPlatforms.add("UhK9l6yRk");
//        productPlatforms.add("LP4jwN7fA");
//        String productPlatform = StringUtil.getProductPlatform(productPlatforms);
//        System.out.println(productPlatform);
//        Float sqcost=1500F;
//        if (0<=sqcost&&sqcost<=10){
//            System.out.println("0-10");
//        }else if (11<=sqcost&&sqcost<=50){
//            System.out.println("11-50");
//        }else if (51<=sqcost&&sqcost<=150){
//            System.out.println("50-150");
//        }else if (151<=sqcost){
//            System.out.println("150以上");
//        }
//        List<String> productPlatformList = StringUtil.getProductPlatformList("1,2,3,4");
//        System.out.println(productPlatformList);
//        for (String s:productPlatformList){
//            System.out.println(s);
//        }
//         int a = 3/2;
//        System.out.println(a);
        String a ="1";
        String b ="[\"1\"]";
        System.out.println(a.contains("1"));
        System.out.println(b.contains("1"));

    }
}
